import request from '../utils/request';

//获取信息
export const getcustomer = query => {
    return request({
        url: '/system/apis/consumer',
        method: 'get',
        params: query
    });
};

//更新
export const fetchupdatecustomer = query => {
    return request({
        url: '/system/apis/consumer',
        method: 'put',
        data: query
    });
};

//添加顾客信息
export const addcustomer = query => {
    return request({
        url: '/system/apis/consumer',
        method: 'post',
        data: query,
    });
};

export const customerdelete = query => {
    return request({
        url: '/system/apis/consumer',
        method: 'delete',
        data: query
    });
};


export const fetchgetgoods = query => {
    return request({
        url: '/system/apis/goods',
        method: 'get',
        params: query
    });
};

export const fetchgetvendor = query =>{
    return request({
        url:'/system/apis/factory',
        method:'get',
        params: query
    });
}

export const fetchaddvendor = query =>{
    return request({
        url:'/system/apis/factory',
        method:'put',
        data: query
    });
}

export const fetchdeletevendor = query =>{
    return request({
        url:'/system/apis/factory',
        method:'delete',
        data: query
    });
}

export const fetchupdatevendor = query =>{
    return request({
        url:'/system/apis/factory',
        method:'post',
        data: query
    });
}

export const fetchgetdetails = query =>{
    return request({
        url: '/system/apis/details',
        method: 'get',
        data: query
    });
};

export const detailsdelete = query => {
    return request({
        url: '/system/apis/details',
        method: 'delete',
        data: query
    });
};


export const goodsdelete = query => {
    return request({
        url: '/system/apis/goods',
        method: 'delete',
        data: query
    });
};


//添加商品信息
export const Addgoods = query => {
    console.log(query)
    return request({
        url: '/system/apis/goods',
        method: 'post',
        data: query,
    });
};

//添加订单
export const fetchBuyGoods = query => {
    return request({
        url: '/system/apis/order',
        method: 'post',
        data: query,
    });
};

export const fetchgetorders = query => {
    return request({
        url: '/system/apis/order',
        method: 'get',
        data: query,
    });
};

export const fetchdeleteorders = query => {
    return request({
        url: '/system/apis/order',
        method: 'delete',
        data: query,
    });
};

